﻿using System.Collections.Generic;
using System.Windows;
using Kiva7.Controls;
using Kiva7.DataClasses;
using Kiva7.DataRequests;

namespace Kiva7.Pages
{
    public partial class LoanAndDetailControl : BaseUserControl
    {
        public LoanAndDetailControl()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            LoanDetailRequest loan = DataContext as LoanDetailRequest;

            if (loan != null
                && loan.SingleData != null)
            {
                DoNavigate(LoanDetailPage.GetPageUrl(new List<Loan>() {loan.SingleData}, 0));
                
            }
        }


        public void Speak()
        {
            media.Speak();
        }

        public void TranslateTextWithDetect()
        {
            useTranslation.TranslateTextWithDetect();
        }
    }
}
